home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / clearmem.arc / READ_ME < prev   
Internet Message Format  |  1988-08-19  |  2KB

  1. From dillon@CORY.BERKELEY.EDU (Matt Dillon) Mon Aug 15 23:43:00 1988
  2. Path: caen.engin.umich.edu!mailrus!ncar!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon
  3. From: dillon@CORY.BERKELEY.EDU (Matt Dillon)
  4. Newsgroups: comp.sys.atari.st
  5. Subject: ASSEMBLY MOVE/CLEAR/SET/COMPARE ROUTINES (was Clearing memory chain)
  6. Message-ID: <8808160343.AA10248@cory.Berkeley.EDU>
  7. Date: 16 Aug 88 03:43 GMT
  8. Sender: daemon@ucbvax.BERKELEY.EDU
  9. Lines: 291
  10.  
  11. >I think this problem could be solved quite simply by using one of the reserved
  12. >fields in the GEMDOS executable program header.  One of these fields could be
  13. >used for telling the OS that it does not have to clear the TPA beforeexecuting
  14.     
  15.     Half of this conversation is silly.  Since when is clearing memory
  16. slow?  A properly written memory-set/clear function will use, say, 12 or 13
  17. registers filled with the pattern and then loop on movem.l instruction.
  18.  
  19.     Needless to say, this is *fast*.  Very fast, in fact.
  20.  
  21.     And before some of the less sophisticated start blabbering about
  22. special cases, following is some *GENERAL* 68K code for clearing, moving,
  23. and comparing memory.
  24.  
  25.     All routines work on arbitrary boundries, and optimize according to
  26. the block size and alignment, all the way to using multiple-register moves
  27. to accomplish the goal.  bmov() will do either an ascending or decending
  28. copy accordingly, allowing for overlapped moves.
  29.  
  30. SPECIAL NOTES:
  31.     -All calls take 32 bit quantities for any pointers or integers.  Note
  32.     -especially that the BSET() function takes a long for the fill
  33.      character even though only a char is used.  Simply modify the code
  34.      to fill your needs.
  35.  
  36.     -This assembles under the Aztec assembler.  Some modifications may
  37.      be required to work on other assemblers.  However, the code is
  38.      COMPLETELY self contained.
  39.  
  40.     -Code is set up for being called from C, with arguments pushed on
  41.      the stack in reverse argument (i.e. first arg is 4(sp), second is
  42.      8(sp), and third is 12(sp) on entry to the call)
  43.  
  44.     -D0/D1/A0/A1 are all assumed to be scratch and are not saved.
  45.  
  46.                         -Matt
  47.  
  48.